<template>
  <div class="my-container">
    <div class="my-navbar"></div>
    <div class="my-top-panel-wrap">
      <div class="mtpw-content">
        <van-image template="icon"
                   class="avatar"
                   round
                   fit="cover"
                   src="images/mine/icon_user.png" />

        <div class="my-user-info-detail">
          <div class="muid-baseinfo">
            <span class="muid-username">张三</span>
            <span class="muid-status">在职</span>
          </div>
          <div class="muid-job">教授</div>
        </div>

        <van-button size="small"
                    class="logout-btn"
                    round
                    v-if="$store.state.systemConfig.servMode === 'brwoser'"
                    @click="dologout">退出登录
          <van-icon name="exchange" />
        </van-button>
      </div>
    </div>
    <van-grid :column-num="3"
              class="my-user-content"
              :border="false">
      <van-grid-item>
        <template #text>
          <div class="muc-top">594.49</div>
          <div class="muc-buttom">科研到款</div>
        </template>
      </van-grid-item>
      <van-grid-item>
        <template #text>
          <div class="muc-top">594.49</div>
          <div class="muc-buttom">科研到款</div>
        </template>
      </van-grid-item>
      <van-grid-item>
        <template #text>
          <div class="muc-top">594.49</div>
          <div class="muc-buttom">科研到款</div>
        </template>
      </van-grid-item>
    </van-grid>
    <!-- 用户详细信息 -->
    <div class="userdetail-wrap">
      <div class="userdetail-content">
        <span class="userdetail-title">职工号</span>
        <span class="userdetail-text">001</span>
      </div>
      <div class="userdetail-content">
        <span class="userdetail-title">性别</span>
        <span class="userdetail-text">男</span>
      </div>
      <div class="userdetail-content">
        <span class="userdetail-title">人事单位</span>
        <span class="userdetail-text">电影学</span>
      </div>
      <div class="userdetail-content">
        <span class="userdetail-title">所属单位</span>
        <span class="userdetail-text">电影学</span>
      </div>
      <div class="userdetail-content">
        <span class="userdetail-title">职称</span>
        <span class="userdetail-text">高等学校教师-教授</span>
      </div>
      <div class="userdetail-content">
        <span class="userdetail-title">一级学科</span>
        <span class="userdetail-text">军事-特种兵医学</span>
      </div>
    </div>
    <index-footer></index-footer>
  </div>
</template>

<script>
import { useRouter } from 'vue-router'
import IndexFooter from '@/pages/Index/IndexFooter.vue'
import { useStore } from 'vuex'
export default {
  components: {
    IndexFooter
  },
  setup () {
    const router = useRouter()
    const store = useStore()
    const dologout = () => {
      store.dispatch('logout')
      router.push('/login')
    }
    return {
      dologout
    }
  }
}
</script>

<style  scoped >
.logout {
  text-align: center;
}

.my-user-info {
  background: #4073f5;
  height: 117px;
  box-sizing: border-box;
  padding: 53px 19px 47px 19px;
}

.avatar {
  box-sizing: border-box;
  width: 66px;
  height: 66px;
  /* border: 3px solid #fff; */
  margin-right: 14px;
}

.name {
  color: #fff;
}

.van-grid.van-hairline--top.my-user-content {
  width: 90vw;
  margin: auto;
  margin-top: -29px;
  border-radius: 9px;
  overflow: hidden;
  transform: translate(0, 0);
}

.userdetail-wrap {
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  align-items: center;
}
.userdetail-content {
  width: 345px;
  height: 44px;
  display: flex;
  flex-direction: row;
  align-content: stretch;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 12px 15px;
  box-sizing: border-box;
  margin-top: 10px;
}
.userdetail-content > span {
  line-height: 20px;
  font-size: 14px;
  font-weight: normal;
}
.userdetail-title {
  color: #222;
}
.userdetail-text {
  color: #666666;
}
.muc-top {
  font-weight: 500;
  color: #000000;
  font-size: 18px;
}
.muc-buttom {
  font-weight: normal;
  font-size: 12px;
  line-height: 20px;
}

.van-grid.my-user-content {
  width: 345px;
  border-radius: 2px;
  overflow: hidden;
  margin: auto;
  margin-top: -24px;
}
.my-container {
  height: 100vh;
  width: 100vw;
  background: #f7f7f7;
}

.mtpw-content {
  display: flex;
  flex-direction: row;
  align-content: center;
  justify-content: flex-start;
  align-items: center;
}
.my-top-panel-wrap {
  width: 100vw;
  background: #4073f5;
  height: 117px;
  padding: 10px 19px;
  box-sizing: border-box;
}

.muid-username {
  font-size: 15px;
}
span.muid-status {
  font-size: 12px;
  background: #28ba8e;
  padding: 4px 8px;
  margin-left: 9px;
  border-radius: 2px;
}

.my-user-info-detail {
  color: #fff;
}

.muid-baseinfo {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.logout-btn {
  color: #fff;
  border: 0;
  background: #3168f4;
  border-radius: unset;
  position: absolute;
  right: 11px;
}
.my-navbar {
  height: 44px;
  background: #4073f5;
}
</style>